import React, { Component } from "react";
let timer = null;
class Index extends Component {
  asd() {
    clearTimeout(timer);
    timer = setTimeout(() => {
      console.log(1);
    }, 1000);
  }
  render() {
    return (
      <div>
        <button onClick={this.asd.bind(this)}>点击</button>
      </div>
    );
  }
}

export default Index;
